package org.javagril.yuetong.mapper;


import org.apache.ibatis.annotations.Param;
import org.javagril.yuetong.bean.Truck;

import java.util.List;

public interface TruckMapper {
    int deleteByPrimaryKey(Integer truckid);

    int insert(Truck record);

    int insertSelective(Truck record);

    Truck selectByPrimaryKey(Integer truckid);

    int updateByPrimaryKeySelective(Truck record);

    int updateByPrimaryKey(Truck record);

    Long getTotal();
    /*分页查询*/
    List<Truck> getAllTrucksByPage(@Param("page") Integer page, @Param("size") Integer size);

    List<Truck> getTruckTeamByTruckTeamId(Integer id);

    /*车辆车队信息*/
    Integer updateTruckByTruckTeamId(@Param("teamid") Integer teamid, @Param("tids") Integer[] tids);

    /*修改更新车队信息*/
    Integer updateTruckByTtId(Integer teamid);


    /*查询分配车辆的信息*/
    List<Truck> getTruckByPageAndState(@Param("page") Integer page, @Param("size") Integer size, @Param("state") Integer state);

    /*通过state 获取分配车辆的总数*/
    Long getTotalByState(Integer state);
}